<template>
	<view class="flex-row text-item" @click="goto">
		<view class="flex-row" style="width: 60%;">
			<image :src="iconSrc" style="margin-left: 8%;"></image>
			<view class="text-item-text">{{itemText}}</view>
		</view>
		<text v-show="infoText" @click="callPhone">{{infoText}}</text>
		<image v-show="infoText == null" src="../../static/goto.png" class="goto-img" @tap="goto"></image>
	</view>
</template>

<script>
	export default {
		props: {
			infoText: '',
			iconSrc: '',
			itemText: '',
			callPhoneNumber: false,
			myOrder: false,
			coupon: false,
			feedBack: false,
      myMsg: false
		},
		methods: {
			callPhone() {
				if(this.callPhoneNumber) {
					uni.makePhoneCall({
					    phoneNumber: '440551'
					});
				}	
			},
			goto() {
				if(this.myOrder) {
					uni.navigateTo({
						url: '../../../pages/myOrder/myOrder'
					})
				}
				if(this.coupon) {
					uni.navigateTo({
						url: '../../../pages/coupon/coupon'
					})
				}
				if(this.feedBack) {
					uni.navigateTo({
						url: '../../../pages/feedBack/feedBack'
					})
				}
        if(this.myMsg) {
        	uni.navigateTo({
        		url: '../../../pages/myMessage/myMessage'
        	})
        }
			}
		}
	}
</script>

<style>
</style>
